$(function(){
	var str = getCookie("order");
	if(str){
		var orderObj = JSON.parse(str);
		for(var i=0; i<orderObj.length; i++){
			var oPc=orderObj[i].oMoney;
			var oNum=orderObj[i].oPicval;
			var oimg=orderObj[i].oImg;
			var oZi=orderObj[i].oIzi;
			var Color=orderObj[i].oColor;
			var ocur=orderObj[i].oCur;
			console.log(oNum)
			$("#banner .w .shopinfor .shangpin .sp_ul .three .scprice").html(oPc);
			$("#banner .w .shopinfor .shangpin .sp_ul .four .nums").val(oNum);
			$(".one img").attr("src",oimg);
			$(".shangpin .one .oword").html(decodeURIComponent
(oZi));
			$(".curcolor").html(decodeURIComponent
(Color));
            $(".cursize").html(ocur);
			var all=(oPc*oNum).toFixed(2);
            $(".zongjia").html(all);
            $(".zongjia2").html(all);

		}
	}else{
		
	}
		
	
	$(".jia").click(function(){
		var num= parseInt($(".nums").val());
		num++;
		$(".nums").val(num);
		var oPrice=Number($("#banner .w .shopinfor .shangpin .sp_ul .three .scprice").html());
		var all = (num*oPrice).toFixed(2);
		$(".zongjia").html(all);
		$(".zongjia2").html(all);
	});
	
	$(".jian").click(function(){
		var num= parseInt($(".nums").val());
		num--;
		if(num<1){
			num = 1
		}		
		$(".nums").val(num);
		var oPrice=Number($("#banner .w .shopinfor .shangpin .sp_ul .three .scprice").html());
		var all = (num*oPrice).toFixed(2);
		$(".zongjia").html(all);
		$(".zongjia2").html(all);		
	});
	
	
	
	
	$(".re_move").click(function(){
		$(".goshop").css("display","block");
		$(".shangpin").css("display","none");
		removeCookie("order");	
	})

})
